package com.example.wtt.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

//利用lombok插件生成数据的get()和set(),有参构造和无参构造
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_user")
public class User {
    @Alias("UserID")
    @TableId(type = IdType.AUTO)
    private Integer id;
    @Alias("用户名")
    private String username;
    @Alias("密码")
    @JsonIgnore
    private String password;
    @Alias("邮箱")
    private String email;
    @Alias("创建时间")
    private Date createTime;
    @Alias("头像")
    @TableField("avatar")
    private String avatarUrl;
    @Alias("schoolName")
    @TableField("school_name")
    private String schoolName;
    @Alias("userStatus")
    @TableField("user_status")
    private Integer userStatus;
    @Alias("usageTimes")
    @TableField("usage_times")
    private Integer usageTimes;
}
